package com.tianquan.spring;/**
 * @description:
 * @author tianquan
 * @date 2024-11-11 上午10:22
 */

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @BelongsProject: uploaddemo
 * @BelongsPackage: com.tianquan.spring
 * @Author: tianquan
 * @CreateTime: 2024-11-11  10:22
 * @Description: TODO
 * @Version: 1.0
 */
@Component
public class ABeanBeanPostProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if (beanName.equals("bean")) System.out.println("Bean的前置处理postProcessBeforeInitialization");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if (beanName.equals("bean")) System.out.println("Bean的后置处理postProcessAfterInitialization");
        return bean;
    }

}
